﻿#region Copyright

//  ======================================================
//      Copyright (c) 2011 Toulr All rights reserved.
//     
//      The use and distribution terms for this software are contained in the file
//      named license.txt, which can be found in the root of this distribution.
//      By using this software in any fashion, you are agreeing to be bound by the
//      terms of this license.
//     
//     You must not remove this notice, or any other, from this software.
//  ======================================================

#endregion

#region Using Namespaces

using System;
using System.ComponentModel.DataAnnotations;
using Toulr.Domains.Account;

#endregion

namespace Toulr.Domains.Business
{
    /// <summary>
    ///   订单信息
    /// </summary>
    public class Order
    {
        #region Property

        /// <summary>
        ///   记录ID
        /// </summary>
        [Key]
        public Int32 Id { get; set; }

        /// <summary>
        /// 支付信息ID
        /// </summary>
        public int BillId { get; set; }

        /// <summary>
        ///   消费用户
        /// </summary>
        public int BillUserId { get; set; }

        /// <summary>
        ///   订单号
        /// </summary>
        [MaxLength(16)]
        public String BillNo { get; set; }

        /// <summary>
        ///   成交时间
        /// </summary>
        [Required]
        public DateTime TurnoverTime { get; set; }

        /// <summary>
        ///   消费的店铺
        /// </summary>
        [Required]
        public int ShopId { get; set; }

        /// <summary>
        ///   消费的商品
        /// </summary>
        [Required]
        public int GoodId { get; set; }

        /// <summary>
        ///   商品标题（名称）
        /// </summary>
        [MaxLength(200)]
        public String GoodTitle { get; set; }

        /// <summary>
        ///   订单对应的促销（团购）信息
        /// </summary>
        public int PromotionId { get; set; }

        /// <summary>
        ///   购买数量
        /// </summary>
        [Required]
        public int BuyCount { get; set; }

        /// <summary>
        ///   需支付金额
        /// </summary>
        public float TotalPrice { get; set; }

        /// <summary>
        ///   订单状态
        /// </summary>
        public int StatusId { get; set; }

        /// <summary>
        ///   快递公司Id
        /// </summary>
        public int ExpressDeliveryId { get; set; }

        /// <summary>
        ///   订单备注
        /// </summary>
        [MaxLength(120)]
        public String Remark { get; set; }

        /// <summary>
        ///   订单结束时间
        /// </summary>
        public DateTime DoneTime { get; set; }

        #endregion

        #region Associaction Objects

        /// <summary>
        ///   消费用户
        /// </summary>
        [NotMapped]
        public virtual User BillUser
        {
            get { throw new NotImplementedException(); }
        }

        /// <summary>
        ///   订单对应的促销（团购）信息Id
        /// </summary>
        [NotMapped]
        public virtual Promotions Promotion
        {
            get { throw new NotImplementedException(); }
        }

        /// <summary>
        ///   订单状态
        /// </summary>
        [NotMapped]
        public virtual OrderStatus Status
        {
            get { throw new NotImplementedException(); }
        }

        /// <summary>
        ///   快递公司Id
        /// </summary>
        [NotMapped]
        public virtual ExpressDelivery ExpressDelivery
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}